
<script src="<{$template_dir}>admin/js/echarts.js"></script>
<script src="<{$template_dir}>admin/js/china.js"></script>
<script src="<{$template_dir}>admin/js/china_map_data.js"></script>

<div id="content" style="background-color:#ffffff">
<div id="content-header">
  <div id="breadcrumb"> <a href="?m=admin&t=main" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 系统首页</a> <a href="?m=admin&t=main" title="Go to Home" class="tip-bottom">发票模块</a> <a href="#" class="current">趋势分析</a> </div>
</div>
<div class="container-fluid" >
  
  <div class="row-fluid" >
  
    <div class="site-tips site-text">
      
           
        <form class="layui-form " action="?m=admin&o=ticket&t=statistics&id=<{$gvar.fget.id}>" method="get">
             <input type='hidden' name='m' value='<{$gvar.fget.m}>'>
             <input type='hidden' name='o' value='<{$gvar.fget.o}>'>
             <input type='hidden' name='t' value='<{$gvar.fget.t}>'>
             <input type='hidden' name='id' value='<{$gvar.fget.id}>'>
             
              <label class="layui-form-label">天数</label>
            <div class="layui-input-inline">
              <select name="day">
             
                 <option value="7" <{if $gvar.fget.day==7}>selected<{/if}>>7天</option>
                 <option value="30"<{if $gvar.fget.day==30}>selected<{/if}>>30天</option>
                 <option value="90"<{if $gvar.fget.day==90}>selected<{/if}>>90天</option>
              </select>
            
            </div>
             
          	渠道
            <div class="layui-input-inline">
              <select name="channel_id">
              <option value="">请选择渠道</option>
                 <{foreach item=v from=$channel_data}>
                     <option value="<{$v.id}>"<{if $v.id==$gvar.fget.channel_id}>selected<{/if}> ><{$v.channel_name}></option>
                 <{/foreach}>
              </select>
            
            </div>
           <!-- 商户
            <div class="layui-input-inline">
              <select name="business_id">
              <option value="">月</option>
                <{foreach item=v from=$month}>
                     <option value="<{$v}>" <{if $gvar.fget.month}><{if $v==$gvar.fget.month}>selected<{/if}><{else}><{if $v==date('m')}>selected<{/if}><{/if}>><{$v}>月</option>
                 <{/foreach}>
              </select>
            
            </div>-->
           <button type='submit' class="layui-btn layui-btn-normal" style="background-color:#FF5722">搜索</button>
        
        </form> 
     
    </div>
 
  
  
<fieldset class="layui-elem-field layui-field-title">
  <legend>开票走向</legend>
</fieldset>
	  
      <div id='ticket_num' style="height:400px; width:50%; float:left"></div>
      <div id='ticket_price' style="height:400px; width:50%;float:left"></div>
<div></div>   
<fieldset class="layui-elem-field layui-field-title">
  <legend>接口走向</legend>
</fieldset>
	  
       <div id='api_type' style="height:400px; width:50%; float:left"></div>
       <div id='api' style="height:400px; width:50%; float:left"></div>
   </div>
</div>

<script>
layui.use('form')
</script>   
<!--开票量-->
<script>
var myChartMobile = echarts.init(document.getElementById('ticket_num'));
option = {
    title: {
        text: '开票量'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
         data:['待开票','已开票','已冲红']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: [<{$date}>]
    },
    yAxis: {
        type: 'value'
    },
    series: [
		<{foreach key=k item=v from=$ticket}>
        {
            name:'<{$k}>',
            type:'line',
            stack: '总量',
			areaStyle: {normal: {}},
			<{if $k=='待开票'}>
			label: {
                normal: {
                    show: true,
                    position: 'top'
                }
            },
			<{/if}>
            data:[<{$v}>]
        },
        <{/foreach}>
       
    ]
};

myChartMobile.setOption(option);

</script>

<!--开票金额-->
<script>
var myChartMobile = echarts.init(document.getElementById('ticket_price'));
option = {
    title: {
        text: '开票金额',
		 left: '3%',
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:['待开票','已开票','已冲红']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: [<{$date}>]
    },
    yAxis: {
        type: 'value'
    },
    series: [
       <{foreach key=k item=v from=$ticket_price}>
        {
            name:'<{$k}>',
            type:'line',
            stack: '总量',
			areaStyle: {normal: {}},
			<{if $k=='待开票'}>
			label: {
                normal: {
                    show: true,
                    position: 'top'
                }
            },
			<{/if}>
            data:[<{$v}>]
        },
        <{/foreach}>
       
    ]
};

myChartMobile.setOption(option);

</script>

<!--接口类型-->
<script>
var myChartMobile = echarts.init(document.getElementById('api_type'));
option = {
    title : {
        text: '接口类型分布',
        //subtext: '纯属虚构',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        left: 'left',
        data: [
			<{foreach key=k item=v from=$log_type}>
				'<{$k}>',
			<{/foreach}>
		]
    },
    series : [
        {
            name: '数量',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[
			<{foreach item=v key=k from=$log_type}>
				
				 {value:<{$v}>, name:'<{$k}>'},
			<{/foreach}>
               
                
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};

myChartMobile.setOption(option);
</script>

<!--接口访问量-->
<script>
var myChartMobile = echarts.init(document.getElementById('api'));
option = {
    title: {
        text: '接口访问量'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data:[<{foreach key=k item=v from=$log_type}>
				'<{$k}>',
			<{/foreach}>]
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: [<{$log_date}>]
    },
    yAxis: {
        type: 'value'
    },
    series: [
       
        <{foreach key=k item=v from=$log}>
			 {
				name:'<{$k}>',
				type:'line',
				stack: '总量',
				data:[<{$v}>]
			},
		<{/foreach}>
       
    ]
};


myChartMobile.setOption(option);
</script>

<script>
layui.use(['layer'], function(){
 	var layer = layui.layer

});

</script>